package com.wkk.websocket.dto;

import com.wkk.websocket.group.GroupChat;
import com.wkk.websocket.group.SingleChat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author : WangKeKe
 * @date : 2020/9/30 15:48
 * Description : 消息发送
 */

@Data
@Accessors(chain = true)
@ApiModel(description = "发送消息")
public class MessageSendDto {

    @ApiModelProperty("消息内容")
    @NotEmpty(message = "消息内容不能为空", groups = {SingleChat.class, GroupChat.class})
    private String content;

    @ApiModelProperty("接收者ID组")
    @NotEmpty(message = "接收者不能为空", groups = {SingleChat.class, GroupChat.class})
    @Pattern(regexp = "^(?!.*，)[^,]*$", groups = SingleChat.class, message = "私聊接收者只能为一个人")
    private String receiveIds;
}
